import java.util.Scanner;

public class Solution {
    public boolean detectCapitalUse(String word){
        if(word.length()>=2 && Character.isLowerCase(0) && Character.isUpperCase(1)){
            return false;
        }
        for (int i = 2; i < word.length(); i++) {
            if(Character.isLowerCase(word.charAt(i)) ^ Character.isLowerCase(1)){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()){
            String string = scanner.nextLine();
            Solution solution = new Solution();
            System.out.println(solution.detectCapitalUse(string));
        }
    }
}
